import Vue from 'vue'
import Vuex from 'vuex'
// import VuexPersist from 'vuex-persist'
import createPersistedState from 'vuex-persistedstate'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import asyncRouter from './modules/async-router'
import getters from './getters'

Vue.use(Vuex)

// const vuexPersisted = new VuexPersist({
//   storage: window.sessionStorage
// })

export default new Vuex.Store({
  modules: {
    asyncRouter
  },
  state: {

  },
  mutations: {
    CLEAR_STATE: (state) => {

    },
    CLEAR_REFRESH_STATE:  (state) => {

    },
  },
  actions: {

  },
  getters,
  // plugins: [vuexPersisted.plugin]
  plugins: [
    // createPersistedState({ storage: window.sessionStorage })
  ]
})
